<!--
描述：库房
开发人：zangyanming
开发日期：2018年8月7日
-->

<template lang="pug">
    kalix-dialog.user-add(bizKey="handMan" ref="kalixBizDialog" v-bind:form-model.sync="formModel" v-bind:targetURL="targetURL")
        div.el-form(slot="dialogFormSlot")
            div.s-flex
                el-form-item.s-flex_item(label="代码" prop="code" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.code" v-bind:readonly="isReadonly")
            div.s-flex
                el-form-item.s-flex_item(label="姓名" prop="name" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.name")
            div.s-flex
                el-form-item.s-flex_item(label="备注" prop="memo" v-bind:label-width="labelWidth")
                    el-input(v-model="formModel.memo")
</template>

<script type="text/ecmascript-6">
    import FormModel from './model'
    import {HandManURL} from '../../config.toml'

    export default {
        name: 'HandManAdd',
        data() {
            return {
                formModel: Object.assign({}, FormModel),
                rules: {
                    //  userId: [{type: 'number', required: true, message: '请输入学生姓名', trigger: 'change'}]
                },
                targetURL: HandManURL,
                labelWidth: '120px',
                params: {kclb: 0},
                isReadonly: false
            }
        },
        components: {},
        mounted() {
            setTimeout(() => {
                if (this.formModel.id > 0) {
                    this.isReadonly = true;
                }
            }, 20)
        },
        methods: {}
    }
</script>

<style scoped lang="stylus">
    .el-form
        padding 30px 70px 30px 20px
</style>
